function [targetNum, rangebin, dopplerbin,  powerbin, snrbin, noisebin] = peaksearch_2D_cross(point_num, RAmap, rangeInd, dopplerInd,  ...
                                                                                                                                                            fft2D_num, fft1D_num, snrest, noise)

targetNum = 0;
rangebin = [];
% angbin = [];
dopplerbin = [];
powerbin = [];
snrbin = [];
noisebin = [];
% second_factor = 0.4;

% rangebin_temp = [];
% angbin_temp = [];
% dopplerbin_temp = [];
% powerbin_temp = [];

for i = 1:point_num
    rangepos = rangeInd(i);
    dopplerpos = dopplerInd(i);
    
%     targetNum_temp = 0;
%     onerange = RAmap(:,rangepos);
%     if rangepos > 100
%         powThr = pre_thr(5);
%     end
%     if rangepos <= 100 &&  rangepos >75
%         powThr = pre_thr(4);
%     end
%     if rangepos <= 75 &&  rangepos >50
%         powThr = pre_thr(3);
%     end
%     if rangepos <= 50 &&  rangepos >25
%         powThr = pre_thr(2);
%     end
%     if rangepos <= 25
%         powThr = pre_thr(1);
%     end
    
%     for j = 1:fft2D_num
        curtpow = RAmap(dopplerpos,rangepos);
%         if curtpow <= powThr
%             continue
%         end
        
        if dopplerpos == 1
            prepow = RAmap(fft2D_num,rangepos);
        else
            prepow = RAmap(dopplerpos-1,rangepos);
        end
        if dopplerpos == fft2D_num
            nextpow = RAmap(1,rangepos);
        else
            nextpow = RAmap(dopplerpos+1,rangepos);
        end
        if rangepos == 1
            lefttpow = RAmap(dopplerpos,fft1D_num);
        else
            lefttpow = RAmap(dopplerpos,rangepos -1);
        end
        if rangepos == fft1D_num
            righttpow = RAmap(dopplerpos,1);
        else
            righttpow = RAmap(dopplerpos,rangepos + 1);
        end
%         if curtpow > powThr
            if curtpow > nextpow && curtpow > prepow
                if curtpow > lefttpow && curtpow > righttpow
                    targetNum = targetNum +1;
                    rangebin(targetNum) = rangepos;
                    dopplerbin(targetNum) = dopplerpos;
                    powerbin(targetNum) = curtpow;  
%                     snrbin(targetNum)  =  snrest(i);
%                     noisebin(targetNum) = noise(i);
                end
            end
                
%          end
%     end
%     if targetNum_temp > 0
%         pow_max = powerbin_temp(1);
%         for k = 2:targetNum_temp
%             if pow_max < powerbin_temp(k)
%                 pow_max = powerbin_temp(k);
%             end
%         end
%         for k = 1:targetNum_temp
% %             if powerbin_temp(k) > pow_max * second_factor
%                 targetNum = targetNum +1;
%                 rangebin(targetNum) = rangebin_temp(k);
%                 dopplerbin(targetNum) = dopplerbin_temp(k);
% %                 angbin(targetNum) = angbin_temp(k);
%                 powerbin(targetNum) = powerbin_temp(k);  
%                 snrbin(targetNum)  =  snrest(i);
%                 noisebin(targetNum) = noise(i);
% %             end
%         end
%         if targetNum_temp == 1
%             targetNum = targetNum +1;
%             rangebin(targetNum) = rangebin_temp(1);
%             dopplerbin(targetNum) = dopplerbin_temp(1);
% %             angbin(targetNum) = angbin_temp(1);
%             powerbin(targetNum) = powerbin_temp(1);  
%         end
%     end

end




end